using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Threading;

namespace DevExpress.Demos {
	public partial class WebBrowser : DevExpress.XtraEditors.XtraUserControl {
		public WebBrowser() {
			InitializeComponent();
			Navigate("about:blank");
			this.Text = "";
            webMain.PreviewKeyDown += new PreviewKeyDownEventHandler(webMain_PreviewKeyDown);    
		}

        void webMain_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) {
            if(e.Alt && e.KeyCode == Keys.F4) {
                this.FindForm().Close();
            }
        }
		public System.Windows.Forms.WebBrowser WebMain { get { return webMain; } }

		public virtual void Navigate(string url) {
			webMain.Navigate(url);
		}
	}
	
    public class IEControlCreator {
		public static WebBrowser CreateWebBrowser(Control parent) {
			WebBrowser browser = null;
			browser = new WebBrowser();
			browser.Parent = parent;
			browser.Dock = DockStyle.Fill;
			return browser; 
		} 
	}
}
